package com.sky.controller.Common;

import com.sky.result.Result;
import com.sky.service.common.CommomService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description CommonContrller
 * @Author liujiangyuan
 * @Date 2024-10-11-20:34
 */
@RestController
@RequestMapping("/admin/common/")
@Api(tags = "通用接口")
@Slf4j
public class CommonContrller {

    @Autowired
    private CommomService commomService;
    @PostMapping(value = "/upload")
    public Result<String> upload(MultipartFile file) throws Exception {
       String url= commomService.upload(file);
        return Result.success(url);
    }

}//https://itxx.oss-cn-beijing.aliyuncs.com/21ba83ea-1f7a-48d2-bb7c-e5c7008336d2.jpg
